home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Apple Game Sprockets / RAVE SDK 1.06 GM for MacOS / Example Projects / GameScene / GSError.c < prev    next >
Encoding:
Text File  |  1996-03-18  |  1.3 KB  |  51 lines  |  [TEXT/ALFA]

  1. // ===========================================================================
  2. //    
  3. //     GSError.c
  4. //    
  5. //    Copyright (C) 1996 Apple Computer, Inc.  All rights reserved.
  6. //
  7. // ===========================================================================
  8.  
  9.  
  10. // ===========================================================================
  11. //     Includes
  12. // ===========================================================================
  13.  
  14. #include "GSError.h"
  15.  
  16.  
  17. #ifdef kGSDebug
  18.  
  19. // ===========================================================================
  20. //     GSError
  21. // ===========================================================================
  22.     void 
  23. GSError(
  24.     const char*            inMessage)
  25. {
  26. #if (kQAPlatform == kQAMacOS)
  27.     Str255                pascalMessage;
  28.     StringPtr            pascalMessageP;
  29.     const char*            messageP;
  30.     long                length;
  31.     
  32.         // copy the C string inMessage into the Pascal string pascalMessage
  33.     for (pascalMessageP = &pascalMessage[1], messageP = inMessage,
  34.             length = 0; *messageP && length < 255; 
  35.             pascalMessageP++, messageP++, length++) {
  36.         *pascalMessageP = (unsigned char) *messageP;
  37.     }
  38.     
  39.         // set the length of the Pascal string copy of inMessage
  40.     pascalMessage[0] = length;
  41.     
  42.         // break to the low-level debugger with a message string
  43.     DebugStr((ConstStr255Param) pascalMessage);
  44. #else
  45.     fprintf(stderr, "%s\n", inMessage);
  46. #endif
  47. }
  48.  
  49. #endif
  50.  
  51.